grid: Simplify allocating children
authorTimm Bäder <mail@baedert.org>
Wed, 11 Oct 2017 06:25:20 +0000 (08:25 +0200)
committerTimm Bäder <mail@baedert.org>
Wed, 11 Oct 2017 06:50:21 +0000 (08:50 +0200)
allocation->x and allocation->y are always 0. MAX'ing width/height with
1 is also wrong now since 0 is a valid width/height for widgets.

gtk/gtkgrid.c

index 16b6a8948ec7ac8d634969431d80d74343909e1f..50d2865f628f09d411b90850f0b453b50d24a56b 100644 (file)
@@ -1573,10 +1573,10 @@ gtk_grid_request_allocate_children (GtkGridRequest      *request,
       allocate_child (request, GTK_ORIENTATION_HORIZONTAL, child, &x, &width, &ignore);
       allocate_child (request, GTK_ORIENTATION_VERTICAL, child, &y, &height, &baseline);
 
-      child_allocation.x = allocation->x + x;
-      child_allocation.y = allocation->y + y;
-      child_allocation.width = MAX (1, width);
-      child_allocation.height = MAX (1, height);
+      child_allocation.x = x;
+      child_allocation.y = y;
+      child_allocation.width = width;
+      child_allocation.height = height;
 
       if (_gtk_widget_get_direction (GTK_WIDGET (request->grid)) == GTK_TEXT_DIR_RTL)
         child_allocation.x = allocation->x + allocation->width